<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/include/page.jsp"%>
<c:set value="${requestScope.response.data.pageInfoUtil }" var="pageInfoUtil"/>
<c:set value="${requestScope.response.data.list }" var="list"/>
<c:set value="${requestScope.cateResponse.data.list }" var="cateList"/>
<!DOCTYPE html>
<html lang="en">
	<head>
		<title>商品列表 - 西餐厅管理系统</title>
		<%@ include file="/common/include/head_title.jsp"%>
	</head>
	<body>
		<jsp:include page="/header.htm"></jsp:include>
		<div class="hero-search set-bg" data-setbg="img/search-bg.jpg"
			style="background-image: url(&quot;img/search-bg.jpg&quot;);">
			<div class="container">
				<div class="filter-table">
					<form action="${rootPath }/goodsList.htm" class="filter-search">
						<input type="hidden" name="dataType" value="${requestScope.dataType }">
						
						<input type="text" placeholder="请输入关键字"  name="keyword" value="${requestScope.keyword }">
						<div class="nice-select">
							<select id="classifyId" name="classifyId">
								<option value="">请选择</option>
								<c:forEach items="${cateList }" var="listTemp" varStatus="stat">
									<option value="${listTemp.id }" ${requestScope.classifyId == listTemp.id ? 'selected' : '' }>${listTemp.name }</option>
								</c:forEach>
							</select>
						</div>
						<button type="submit">搜索</button>
					</form>
				</div>
			</div>
		</div>
	
		<section class="recipe-section spad">
	        <div class="container">
	            <div class="row">
	            	<c:forEach items="${list }" var="listTemp" varStatus="stat">
		                <div class="col-lg-4 col-sm-6">
		                    <div class="recipe-item">
		                        <a href="${rootPath }/goodsInfo.htm?id=${listTemp.id}" target="_blank">
		                        	<c:choose>
										<c:when test="${listTemp.listImg != null && listTemp.listImg != '' }">
											<a href="${websiteFileUrl}${listTemp.listImg }" target="_blank">
												<img alt="" src="${websiteFileUrl}${listTemp.listImg }" width="250" height="240">
											</a>
										</c:when>
										<c:otherwise>
											<img alt="" src="${rootPath }/img/no_pic.png" width="250" height="240">
										</c:otherwise>
									</c:choose>
		                        </a>
		                        <div class="ri-text">
		                            <div class="cat-name">${listTemp.classify.name }</div>
		                            <a href="${rootPath }/goodsInfo.htm?id=${listTemp.id}" target="_blank">
		                                <h4 title="${listTemp.name }">${fn:substring(listTemp.name,0,subStrLen) }</h4>
		                            </a>
		                            <p title="${listTemp.brief }">${fn:substring(listTemp.brief,0,subStrLen) }</p>
		                        </div>
		                    </div>
		                </div>
	                </c:forEach>
	            </div>
	            <div class="row">
	                <div class="col-lg-12">
	                    <div class="recipe-pagination">
	                        <!-- <a href="#" class="active">首页</a> -->
	                        <a href="${rootPath }/goodsList.htm?classifyId=${requestScope.cateId}&keyword=${requestScope.keyword}&dataType=${requestScope.dataType }&currentPage=1"> << </a>
							<a href="${rootPath }/goodsList.htm?classifyId=${requestScope.cateId}&keyword=${requestScope.keyword}&dataType=${requestScope.dataType }&currentPage=${pageInfoUtil.prePage }"> < </a>
							<a href="${rootPath }/goodsList.htm?classifyId=${requestScope.cateId}&keyword=${requestScope.keyword}&dataType=${requestScope.dataType }&currentPage=${pageInfoUtil.nextPage }"> > </a>
							<a href="${rootPath }/goodsList.htm?classifyId=${requestScope.cateId}&keyword=${requestScope.keyword}&dataType=${requestScope.dataType }&currentPage=${pageInfoUtil.totalPage }"> >> </a>
							${pageInfoUtil.currentPage }/${pageInfoUtil.totalPage }
	                    </div>
	                </div>
	            </div>
	        </div>
	    </section>
		<%@ include file="/common/include/head_footer.jsp"%>
	</body>
</html>